package cn.com.pajx.pajx_visitor_v3.base;

import androidx.fragment.app.Fragment;

/**
 * A simple {@link Fragment} subclass.
 * create an instance of this fragment.
 */
public abstract class BaseMvpFragment<B extends BasePresenter> extends BaseFragment {
    protected B mPresenter;

    @Override
    protected void beforeInitHead() {
        mPresenter = initPresenter();
        mPresenter.attach(this);
    }

    protected abstract B initPresenter();

    @Override
    public void onDestroy() {
        mPresenter.detach();
        //mPresenter.unSubscribe();
        super.onDestroy();
    }

}
